<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--名称:<span th:text="${pname}">1111</span >-->
<!--价格:<span th:text="${price}">1111</span >-->
<!--库存:<span th:text="${stock}">1111</span >-->

<!--<h1>获取请求域-对象-方式1</h1>-->
<!--<p th:text="${p.pname}">11111</p >-->
<!--<p th:text="${p.price}">11111</p >-->
<!--<p th:text="${p.getPname()}">11111</p >-->
<!--<p th:text="${p.getPrice()}">11111</p >-->

<h1>分支</h1>
<p th:if="${#lists.isEmpty(products)}">
         <span>查询结果为空</span>
</p>
<p th:unless="${#lists.isEmpty(products)}">
         <span th:text="${#lists.size(products)}">查询结果不为空</span>
         <span th:text="${products.size()}">查询结果为空</span>
</p>
<h1>迭代</h1>
<ul th:unless="${#lists.isEmpty(products)}">
         <li th:each="product:${products}">
             <span th:text="${product.pname}"></span>
             <span th:text="${product.price}"></span>
             <span th:text="${product.stock}"></span>
         </li>
</ul>

</body>
</html>